// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const { ccclass, property, requireComponent } = cc._decorator;

@ccclass
export default class ScrollTextItem extends cc.Component {
    private _label: cc.Label;

    onLoad() {
        this._label = cc.find("label", this.node).getComponent(cc.Label)
    }

    start() {

    }

    public init(data: string) {
        this.data = data;
    }

    private _data: string = "";
    public set data(value: string) {
        this._data = value;
        if(CC_EDITOR && !this._label){
            this._label = cc.find("label", this.node).getComponent(cc.Label)
        }
        this._label.string = value;
    }
    public get data() {
        return this._data;
    }



    // update (dt) {}
}
